package com.morgan.basemodule.holder

import android.view.View
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 *description：
 *<br>author：caowugao
 *<br>time：2021/2/26 0026 16:51
 */
open class QuickBindingHolder<BINDING : ViewDataBinding>(itemView : View): BaseViewHolder(itemView) {
    protected lateinit var mBinding: BINDING
    init {
        mBinding = DataBindingUtil.bind<BINDING>(itemView)!!
    }

    fun <DATA>bindData(variableId : Int,  value : DATA, needExecuteBinding : Boolean = false) {
        bindData(mBinding, variableId, value, needExecuteBinding)
    }
}